import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();
        while (num != 0) {
            int a = num % 10;
            System.out.println(a);
            num = num / 10;
        }

    }
}
//输出一个整数的每一位，如：123的每一位是3，2，1

